library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(flexdashboard)

# Generate sample data
set.seed(123)
x <- seq(1, 100)
y <- cumsum(rnorm(100))

# Create plotly plot
plot_ly(x = ~x, y = ~y, type = 'scatter', mode = 'lines+markers') %>%
  layout(title = "Interactive Line Plot",
         xaxis = list(title = "X-Axis"),
         yaxis = list(title = "Y-Axis"))
# Generate sample data for the bar plot
set.seed(456)
categories <- rep(c("Category A", "Category B", "Category C"), each = 10)
values <- round(runif(30, 10, 100))
months <- rep(month.abb[1:10], 3)

# Create plotly bar plot with grouped categories
plot_ly(x = ~months, y = ~values, type = 'bar', color = ~categories, 
        colors = c("Category A" = "skyblue", "Category B" = "coral", "Category C" = "lightgreen")) %>%
  layout(barmode = 'group',
         title = "Complex Bar Plot with Categories",
         xaxis = list(title = "Month"),
         yaxis = list(title = "Values"))